package com.atlyn.web;

import com.atlyn.dao.LoginDao;

import java.io.IOException;

public class RLoginServlet extends javax.servlet.http.HttpServlet {
    LoginDao loginDao = new LoginDao();
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        String username = request.getParameter("r_username");
        String password = request.getParameter("r_password");
        System.out.println(username + password);
        if (loginDao.rLogin(username,password) != null){
            request.getRequestDispatcher("/rHome.html").forward(request,response);
        }else {
            System.out.println("登录失败！");
            request.getRequestDispatcher("/切换.html").forward(request,response);
        }
    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {

    }
}
